package com.xbongbong.saas.enums;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * 表单设置公司配置分组
 *
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/1/20 17:20
 * @since v1.0
 */
@Getter
public enum TemplateConfigGroupEnum {
    // 表单设置公司配置分组
//    DUPLICATE_CHECKING_SET(1, RedundantTemplateTypeEnum.CUSTOMER.getCode(), "查重设置"),
//    PHONE_NUMBER_SET(2, RedundantTemplateTypeEnum.CUSTOMER.getCode(), "电话号码设置"),
//    CUSTOMER_OTHER_SET(3, RedundantTemplateTypeEnum.CUSTOMER.getCode(), "其他设置"),
 ;

    private Integer code;
    private Integer businessType;
    private String name;

    TemplateConfigGroupEnum(Integer code, Integer businessType, String name) {
        this.code = code;
        this.businessType = businessType;
        this.name = name;
    }

    public static List<TemplateConfigGroupEnum> getByBusinessType(Integer businessType) {
        List<TemplateConfigGroupEnum> templateConfigGroupEnumList = new ArrayList<>();
        for (TemplateConfigGroupEnum templateCompanyConfigEnum : values()) {
            if (Objects.equals(templateCompanyConfigEnum.getBusinessType(), businessType)) {
                templateConfigGroupEnumList.add(templateCompanyConfigEnum);
            }
        }
        return templateConfigGroupEnumList;
    }
}
